﻿@model WebCalendar.Models.DTOs.CalendarPublicDTO

@{
    ViewBag.Title = "Public";
}

<h2>@String.Format("Public calsendars of {0}", Model.User.UserName)</h2>
@if (Model.Calendars.Count > 0)
{
<table>
@foreach (var item in Model.Calendars)
{
    <tr>
        <td>
            <a href="@Url.Action( "Index", "Calendar", new { id = item.ID, year = DateTime.Now.Year, month = DateTime.Now.Month })">
                <img src="~/Images/calendar.png" style="height:30px;" />
            </a>
        </td>
        <td>
            <a href="@Url.Action( "Index", "Calendar", new { id = item.ID, year = DateTime.Now.Year, month = DateTime.Now.Month })">@item.Name</a>
        </td>
        <td>
            <a href="@Url.Action( "Index", "Appointment", new { id = item.ID})">Make an appointment</a>
        </td>
    </tr>
}
</table>
}else{
    <p>The user has no public calendar.</p>
}
